<%@page pageEncoding="UTF-8" %>
<%@include file="/comm/header.jsp" %>
<div class="container" style="height: 400px">
    <div class="panel panel-default">
        <div class="panel-heading">
         <span class="h4">条件查询</span>
        </div>
        <div class="panel-body">
            <form class="form-inline" id="condition">
            <div class="form-group">
                <lable>姓名：</lable><input type="text" class="form-control" name="username"/>
            </div>
            <div class="form-group">
                <lable>修改日期：</lable>
                <div class="input-group">
                    <input type="date" class="form-control" name="startDate"/>
                    <span class="input-group-addon">-</span>
                    <input type="date" class="form-control" name="endDate"/>
                </div>
            </div>
                <div class="form-group">
                    <label>角色：</label>
                    <select class="form-control" name="roleId">
                        <option value="-1">--不限--</option>
                        <option value="3">销售经理</option>
                        <option value="4">销售总监</option>
                        <option value="8">财务经理</option>
                    </select>
                </div>
                <div class="form-group">
                <a href="javascript:search()" class="btn btn-danger"><i class="fa fa-search"></i> 查询</a>
                </div>
            </form>
        </div>
    </div>
    <div id="toolbar">
        <a class="btn btn-primary"><i class="fa fa-plus-circle"></i>添加用户</a>
        <a class="btn btn-warning" onclick="batchDel()"><i class="fa fa-trash"></i> 批量删除</a>
        <a class="btn btn-success" href="javascript:grant()"><i class="fa fa-trash"></i> 用户授权</a>
    </div>
    <table id="userTb"
    data-toggle="table"
    data-url="sys/user/search"
    data-striped="true"
           data-toolbar="#toolbar"
           data-pagination="true"
           data-side-pagination="server"
           data-page-size="5"
           data-page-list="[5,10,15]"

           >
        <thead>
        <th data-checkbox="true"></th>
     <%--   <th data-radio="true"></th>--%>
            <th data-field="id">编号</th>
            <th data-field="username">姓名</th>
            <th data-field="state" data-formatter="fmtState">状态</th>
            <th data-field="role.name">角色名称</th>
            <th data-field="modifyTime">修改时间</th>
            <th  data-formatter="optFmt" data-events="optEvents">操作</th>
        </thead>
    </table>


    <div id="grant">
        <table id="roleTb"
               data-toggle="table"
               data-url="sys/role/list"
               data-striped="true"
               >
            <thead>
            <th data-radio="true"></th>
            <th data-field="id">编号</th>
            <th data-field="name">名称</th>
            </thead>
        </table>
    </div>
</div>
<%@include file="/comm/footer.jsp" %>
<script src="${ctx}/static/js/user.js"></script>